Skip to content

Conversation

@natemcmaster
Copy link
Owner

Summary

  • Fixes several bugs introduced in f1a8455 that broke app.Option<SomeEnum[]>() with MultipleValue options
  • Corrects ReflectionHelper.IsEnumerableType to properly detect array element types
  • Fixes wrong variable name in ExtractNamesFromEnum (wrappedType2wrappedEnumerableType)
  • Adds array type support to ValueParserProvider.GetParserImpl

Test plan

  • All 797 existing unit tests pass
  • DefaultHelpTextGeneratorTests.ShowHelp now correctly tests Option<SomeEnum[]> with MultipleValue

🤖 Generated with Claude Code

This fixes several issues introduced in f1a8455:

1. ReflectionHelper.IsEnumerableType - The implementation had bugs:
   - type.IsAssignableTo(typeof(IEnumerable<>)) doesn't work for open generics
   - type.GenericTypeArguments[1] was wrong (arrays have element at index 0)
   Rewrote to properly handle arrays and generic types.

2. DefaultHelpTextGenerator.ExtractNamesFromEnum - Used wrong variable
   name (wrappedType2 instead of wrappedEnumerableType).

3. ValueParserProvider.GetParserImpl - Added array type support so
   app.Option<SomeEnum[]>() works with MultipleValue options.

4. Test expectation - Fixed expected help text format for MultipleValue
   options (--enumOpt5 <E> not --enumOpt5[:<E>]).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@natemcmaster natemcmaster merged commit 166c999 into main Dec 27, 2025
0 of 6 checks passed
@natemcmaster natemcmaster deleted the fix/enum-array-help-text branch December 27, 2025 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant